<h1><span></span><?= lang('label_menu_link_addressbooks') ?></h1>

<ul class="breadcrumb">
    <li><a href="<?= base_url() ?>"><?= lang('label_home') ?></a></li>
    <li><a href="<?= base_url('user/profile') ?>"><?= lang('label_profile') ?></a></li>
    <li><?= lang('label_menu_link_addressbooks') ?></li>
</ul>

<div class="page">
    <?php $this->load->view('template/default/user/top') ?>
        <?php $this->load->view('template/default/user/side') ?>
        <div class="profile_page">
            <h2 class="profile_page_title"><?= lang('label_profile') ?> &raquo; <strong><?= lang('label_menu_link_addressbooks') ?></strong></h2>
            <div class="profile_messages">
                <p><strong><?= lang('label_menu_link_addressbooks') ?></strong><?= lang('label_your_address') ?>
                    <br /><br />
					<?php if ($total >= 7) { ?>
                        <a class="replya" style="<?php if(LANG == 'ar') echo 'position: relative; right: 0px; top: 5px; left: 235px;'; else echo 'position: relative; right: 0px; top: 5px; left: 300px;' ?> " href="javascript:void(0)"><?= lang('message_address_max_6') ?></a>
                    <?php } else { ?>
                        <a class="replya" style="top: 0px; position: relative; right: 0px; left: 404px;" href="<?= base_url() ?>addressbook/add"><?= lang('label_add_address') ?></a>
                    <?php } ?>
                </p> 
            </div>

            <? if (!empty($result)) { ?>
                <table id="tablestyle" >
                    <thead>
                    <th style="width:230px;"><?= lang('label_name') ?></th>
                    <th><?= lang('label_mobile') ?></th>
                    <th><?= lang('label_city') ?></th>
                    <!-- <th><?= lang('label_address') ?></th> -->
                    <th></th>
                    </thead>
                    <? foreach ($result as $value) { ?>
                        <tr <?php if ($value->default == 'YES') { ?>style='background-color: #e8f9fd;' title='<?php echo lang('label_default') ?> <?= lang('label_address') ?>'<?php } ?>>
                            <td><a href="<?= base_url() ?>addressbook/edit/<?= $value->id ?>"><?= $value->name ?></a></td>
                            <td><?= $value->mobile ?></td>
                            <td><?= $value->title ?></td>
                            <!-- <td><?= $value->address ?></td> -->
                            <td style="text-align:center;">
                                <a href="<?= base_url('addressbook/edit/' . $value->id) ?>"><?= lang('label_edit') ?></a>
                                <a href="<?= base_url('addressbook/delete/' . $value->id) ?>"><?= lang('label_delete') ?></a>
                            </td>
                        </tr>
                    <? } ?>
                </table>
            </div>
        <?
    } else {
        //$add_button = '<a href="" data-role="button" data-mini="true" data-transition="flow" class="ui-btn-icon-right" data-inline="true" data-icon="puls" data-theme="b">{Add New Address}</a>';
        ?>
        <div class="unsaved">
            <img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/unsaved.png" alt="" />
            <br /><?= lang('message_no_addresses') ?>
        </div>
        <br /><br /><br /><br />
        <?
    }
    ?>





</div>




